<!--
 * @Author: WangGuojian 1085844536@qq.com
 * @Date: 2024-07-01 21:28:36
 * @LastEditTime: 2024-07-02 20:50:30
 * @LastEditors: WangGuojian 1085844536@qq.com
 * @FilePath: \html\code\2_CSS\16_CSS中常用的长度单位\01_CSS_常用长度单位.html
 * @Description:
-->
<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>CSS_常用长度单位</title>
    <style>
        #d1 {
            width: 200px;
            height: 200px;
            font-size: 20px;
            background-color: skyblue;
        }

        #d2 {
            width: 10em;
            height: 10em;
            font-size: 20px;
            background-color: orange;
        }

        #d3 {
            width: 10rem;
            height: 10rem;
            font-size: 20px;
            background-color: green;
        }

        #d4 {
            width: 200px;
            height: 200px;
            font-size: 20px;
            background-color: gray;
        }

        .inside {
            width: 50%;
            height: 25%;
            font-size: 150%;
            background-color: orange;
        }

        .test {
            width: 600px;
            height: 600px;
            font-size: 20px;
            text-indent: 2em;
            background-color: yellowgreen;
        }
    </style>
</head>

<body>
    <div id="d1">1</div>
    <hr>
    <div id="d2"></div>
    <hr>
    <div id="d3"></div>
    <hr>
    <div id="d4">
        <div class="inside"></div>
    </div>
    <hr>
    <div class="test">
        好好学习，天天向上
    </div>
</body>

</html>